package cn.uexpo.lhz.biz.impl;

import java.util.List;

import cn.uexpo.lhz.common.oldUtils.PageUtils;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import cn.uexpo.lhz.biz.EventLabelBiz;
import cn.uexpo.lhz.common.oldBase.BOException;
import cn.uexpo.lhz.common.oldUtils.PageRequest;
import cn.uexpo.lhz.common.oldUtils.PageResult;
import cn.uexpo.lhz.dao.EventLabelMapper;
import cn.uexpo.lhz.domain.EventLabel;
import cn.uexpo.lhz.domain.EventLabelExample;

@Service
public class EventLabelBizImpl implements EventLabelBiz {

    @Autowired
    private EventLabelMapper eventLabelMapper;

    @Override
    public int insert(EventLabel record) throws BOException {
        // TODO Auto-generated method stub
        return eventLabelMapper.insert(record);
    }

    @Override
    public int insertSelective(EventLabel record) throws BOException {
        // TODO Auto-generated method stub
        return 0;
    }

    @Override
    public int deleteByPrimaryKey(Integer id) throws BOException {
        // TODO Auto-generated method stub
        return 0;
    }

    @Override
    public int deleteEntity(EventLabel record) throws BOException {
        // TODO Auto-generated method stub
        return 0;
    }

    @Override
    public int deleteByIds(List<Integer> ids) throws BOException {
        // TODO Auto-generated method stub
        return 0;
    }

    @Override
    public int delete(List<EventLabel> records) throws BOException {
        // TODO Auto-generated method stub
        return 0;
    }

    @Override
    public int deleteByExample(EventLabelExample example) throws BOException {
        // TODO Auto-generated method stub
        return 0;
    }

    @Override
    public int updateByPrimaryKey(EventLabel record) throws BOException {
        // TODO Auto-generated method stub
        return 0;
    }

    @Override
    public int updateByPrimaryKeySelective(EventLabel record) throws BOException {
        // TODO Auto-generated method stub
        return 0;
    }

    @Override
    public int updateByExampleSelective(EventLabel record, EventLabelExample example) throws BOException {
        // TODO Auto-generated method stub
        return 0;
    }

    @Override
    public int updateByExample(EventLabel record, EventLabelExample example) throws BOException {
        // TODO Auto-generated method stub
        return 0;
    }

    @Override
    public EventLabel selectByPrimaryKey(Integer id) throws BOException {
        // TODO Auto-generated method stub
        return null;
    }

    @Override
    public EventLabel selectByUniqueCode(String uniqueCode) throws BOException {
        // TODO Auto-generated method stub
        return null;
    }

    @Override
    public List<EventLabel> selectByExample(EventLabelExample example) throws BOException {
        // TODO Auto-generated method stub
        return eventLabelMapper.selectByExample(example);
    }

    @Override
    public long countByExample(EventLabelExample example) throws BOException {
        // TODO Auto-generated method stub
        return 0;
    }

    @Override
    public PageResult findPage(PageRequest pageRequest, EventLabelExample example) throws BOException {
        int pageNum = pageRequest.getPage();
        int pageSize = pageRequest.getLimit();
        PageHelper.startPage(pageNum, pageSize);
        List<EventLabel> records = (List<EventLabel>) eventLabelMapper.selectByExample(example);
        return PageUtils.getPageResult(pageRequest, new PageInfo<EventLabel>(records));
    }

}
